package com.sanyang.lawyer.service.hr;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.sanyang.lawyer.entity.HrFlexigrid;
import com.sanyang.lawyer.entity.HrTeam;
import com.sanyang.lawyer.mapper.hr.HrTeamMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class HrTeamService {
    @Autowired
    private HrTeamMapper hrTeamMapper;

    public HrTeam getByid(int id){
        return hrTeamMapper.selectById(id);
    }
    public List<HrTeam> listALLPage(HrFlexigrid hrFlexigrid){
        return hrTeamMapper.listALLPage(hrFlexigrid);
    }
    public Integer listALLCount(HrTeam hrTeam) {
        return hrTeamMapper.listALLCount(hrTeam);
    }
    public int insert(HrTeam hrTeam){
        return hrTeamMapper.insert(hrTeam);
    }
    public int update(HrTeam hrTeam){
        return hrTeamMapper.updateById(hrTeam);
    }
    public Integer delete(String empId){
        String[]arr=empId.split(",");
        int j=0;
        for (int i=0;i<arr.length;i++){
            hrTeamMapper.deleteById(Integer.parseInt(arr[i]));
            j++;
        }
        if(j>0){
            return 1;
        }else{
            return 0;
        }
    }
}
